package Thread;
//线程的优先级
public class PriorityDemo {
    public static void main(String[] args) {
        Thread min=new Thread(){//低优先级
            public void run(){
                for (int i=0;i<10000;i++){
                    System.out.println("min");
                }
            }
        };
        Thread nor=new Thread(){//默认优先级
            public void run(){
               for (int i=0;i<10000;i++){
                   System.out.println("nor");
               }
            }
        };
        Thread max=new Thread(){//高优先级
            public void run(){
                for (int i=0;i<10000;i++){
                    System.out.println("max");
                }
            }
        };
        min.setPriority(Thread.MIN_PRIORITY);
        nor.setPriority(Thread.NORM_PRIORITY);
        max.setPriority(Thread.MAX_PRIORITY);

        min.start();
        nor.start();
        max.start();
    }

}
